package com.item.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author liuyuanyuan on 2023/12/5
 */
@Controller
public class HelloController {

    @RequestMapping("/hello")
    @ResponseBody
    public String hello(){
        return "hello world123";
    }

    /**
     * curl 'http://localhost:8088/chinese?name=你好&address=123'
     * curl 'http://localhost:8088/chinese' -d 'name=你好' -d 'address=哈哈'
     * @param name
     * @param address
     * @return
     */
    @ResponseBody
    @RequestMapping("/chinese")
    public String chineseGarbled(String name,String address){
        System.out.println(name);
        System.out.println(address);
        return String.format("[%s]-[%s]",name,address);
    }


}
